function drawPoint(x,y,part){
	var c=document.getElementById("myCanvas");
	var cxt=c.getContext("2d");
	cxt.fillStyle="#5bc0de";
	cxt.beginPath();
	cxt.arc(x,y,0,0,Math.PI*2,true);
	cxt.closePath();
	cxt.fill();
	showPoint(x,y,part);
}

var JPos = {};  
(function($){  
    $.$getAbsPos = function(p){  
        var _x = 0;  
        var _y = 0;  
        while(p.offsetParent){  
                _x += p.offsetLeft;  
                _y += p.offsetTop;  
                p = p.offsetParent;  
        }  
          
        _x += p.offsetLeft;  
        _y += p.offsetTop;  
          
        return {x:_x,y:_y};  
    };  
      
    $.$getMousePos = function(evt){  
        var _x,_y;  
        evt = evt || window.event;  
        if(evt.pageX || evt.pageY){  
            _x = evt.pageX;  
            _y = evt.pageY;  
        }else if(evt.clientX || evt.clientY){  
            _x = evt.clientX + document.body.scrollLeft - document.body.clientLeft;  
            _y = evt.clientY + document.body.scrollTop - document.body.clientTop;  
        }else{  
            return $.$getAbsPos(evt.target);      
        }  
        return {x:_x,y:_y};  
    }  
})(JPos);  
  
function vControl(pChoice){  
    switch(pChoice){  
        case "GETMOUSEPOSINPIC":  
            var mPos = JPos.$getMousePos();  
            var iPos = JPos.$getAbsPos(arguments[1]);  
			console.log(mPos.x +"AND"+mPos.y );  
            console.log(iPos.x +"AND"+iPos.y );
            console.log(mPos.x - iPos.x);
            console.log(mPos.y - iPos.y);
            var x = mPos.x - iPos.x;  
            var y = mPos.y - iPos.y; 
            window.status = (mPos.x - iPos.x) + " " + (mPos.y - iPos.y);
            break;  
    }  
}  